/**
 * 客户订货系统，属于杭州升鲜宝科技有限公司，由升鲜宝团队开发
 * 主要特点：不同的客户登录，显示不同的商品，不同的商品价格
 * 内置了简易的进销存系统，方便升鲜宝的客户的客户进行简易的出库、入库、盘点、报损、库存查询
 * 升鲜宝供应商管理系统，全套系统授权源代码使用。方便有一定开发能力的公司与团队进行快速的供应链管理系统开发与应用
 * 联系方式：微信 sxbscm2012  整套源代码0加密，方便二次开发  
 * 联系人： 余东升
 * 手机号码： 19186059021
 * 
 */
import {
	post,
	get,
	put
} from '../utils/request.js'


// 下订单
export const addOrderfromcart = (data = {}) => {
	return post('/api/oms/omsorderbill/addOrderfromcart', {
		data,
	})
}

/**
 * 
 * @description 字典类型接口 
 * @params dictType
 *  配送类型=delivery_type；
 *  订单来源=bill_source；
 *  入库类别=cwms_input_type；
 *  出库类别=cwms_output_type；
 *  报损类别=stocktake_type
 * 
 */
export const dictDataList = (params = {}) => {
	return get('/api/dictData/dictDataList', {
		params,
	})
}

// 订单列表
export const orderOrderList = (params = {}) => {
	return get('/api/oms/omsorderbill/page', {
		params,
	})
}

// 订单作废
export const orderOrderCancel = (data = {}) => {
	return post('/api/oms/omsorderbill/cancelOrder', {
		data
	})
}
// 订单详情
export const orderOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/oms/omsorderbill/' + id, {
		params,
	})
}

// 订单审核
export const orderOrderCheck = (data = {}) => {
	return post('/api/oms/omsorderbill/auditOrder', {
		data
	})
}

// 出库单列表
export const outOrderList = (params = {}) => {
	return get('/api/cwmsinvstockout/page', {
		params,
	})
}

// 出库单作废
export const outOrderCancel = (data = {}) => {
	return post('/api/cwmsinvstockout/updateInvalid', {
		data
	})
}
// 出库单详情
export const outOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/cwmsinvstockout/outCodeInfo/' + id, {
		params,
	})
}

// 出库单审核
export const outOrderCheck = (data = {}) => {
	return post('/api/cwmsinvstockout/updateAudit', {
		data
	})
}
// 出库新增
export const outOrderAdd = (data = {}) => {
	return post('/api/cwmsinvstockout', {
		data
	})
}
// 出库单编辑
export const outOrderEdit = (data = {}) => {
	return put('/api/cwmsinvstockout', {
		data
	})
}

// 入库单列表
export const inOrderList = (params = {}) => {
	return get('/api/cwmsinvstockin/page', {
		params,
	})
}

// 入库单作废
export const inOrderCancel = (data = {}) => {
	return post('/api/cwmsinvstockin/updateInvalid', {
		data
	})
}
// 入库单详情
export const inOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/cwmsinvstockin/inCodeInfo/' + id, {
		params,
	})
}

// 入库单审核
export const inOrderCheck = (data = {}) => {
	return post('/api/cwmsinvstockin/updateAudit', {
		data
	})
}
// 入库单新增
export const inOrderAdd = (data = {}) => {
	return post('/api/cwmsinvstockin', {
		data
	})
}
// 入库单编辑
export const inOrderEdit = (data = {}) => {
	return put('/api/cwmsinvstockin', {
		data
	})
}

// 盘点单列表
export const countOrderList = (params = {}) => {
	return get('/api/cwmsinvstocktake/page', {
		params,
	})
}

// 盘点单作废
export const countOrderCancel = (data = {}) => {
	return post('/api/cwmsinvstocktake/updateInvalid', {
		data
	})
}
// 盘点单详情
export const countOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/cwmsinvstocktake/' + id, {
		params,
	})
}

// 盘点单审核
export const countOrderCheck = (data = {}) => {
	return post('/api/cwmsinvstocktake/updateAudit', {
		data
	})
}

// 盘点单新增
export const countOrderAdd = (data = {}) => {
	return post('/api/cwmsinvstocktake', {
		data
	})
}
// 盘点单编辑
export const countOrderEdit = (data = {}) => {
	return put('/api/cwmsinvstocktake', {
		data
	})
}

// 退货单列表
export const returnOrderList = (params = {}) => {
	return get('/api/oms/omsreturnorder/page', {
		params,
	})
}

// 退货单作废
export const returnOrderCancel = (data = {}) => {
	return post('/api/oms/omsreturnorder/cancelReturnBill', {
		data
	})
}
// 退货单详情
export const returnOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/oms/omsreturnorder/' + id, {
		params,
	})
}

// 退货单审核
export const returnOrderCheck = (data = {}) => {
	return post('/api/oms/omsreturnorder/auditReturnBill', {
		data
	})
}

// 退货单新增
export const returnOrderAdd = (data = {}) => {
	return post('/api/oms/omsreturnorder/addResturnBill', {
		data
	})
}

// 退货单编辑
export const returnOrderEdit = (data = {}) => {
	return post('/api/oms/omsreturnorder/updateResturnBill', {
		data
	})
}


// 收货单列表
export const receiptOrderList = (params = {}) => {
	return get('/api/oms/orderbillaffire/page', {
		params,
	})
}

// 收货单详情
export const receiptOrderDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('/api/oms/orderbillaffire/' + id, {
		params,
	})
}

// 收货保存
export const receiptOrderSave = (data = {}) => {
	return post('/api/oms/orderbillaffire/updateTakeOutOrder', {
		data
	})
}

// 再来一单
export const getOneMoreOrder = (data = {}) => {
	return post('/api/oms/omsorderbill/oneMoreOrder', {
		data
	})
}


// 出库、入库、盘点、库存菜单接口
export const getCategoryList = (params = {}) => {
	return get('/api/cus/mallshopproductstatistics/getCategoryList', {
		params,
	})
}

// 出库、入库、盘点、库存商品接口
export const getCategoryPage = (params = {}) => {
	return get('/api/cus/mallshopproductstatistics/page', {
		params,
	})
}

// 库存明细
export const getCategoryInfo = (params = {}) => {
	return get('/api/cwms/cwmsgoodsinventory/info', {
		params,
	})
}

// 新品需求
export const postCusdeclareSave = (data = {}) => {
	return post('/api/cwms/cusdeclare/save', {
		data
	})
}